use rsa::{RsaPrivateKey, RsaPublicKey};
use rsa::pkcs1::LineEnding;
use rsa::pkcs8::{EncodePrivateKey, EncodePublicKey};

fn generate_keys() {
    let mut rng = rand::thread_rng();
    let bits = 2048;
    let privet_key = RsaPrivateKey::new(&mut rng, bits).expect("failed to generate a key");
    let pub_key = RsaPublicKey::from(&privet_key);

    println!("privet_key key: {:?}", privet_key.to_pkcs8_pem(LineEnding::LF));
    println!("pub_key key: {:?}", pub_key.to_public_key_pem(LineEnding::LF));
}

#[test]
pub fn test() {
    generate_keys();
}


